package com.xja.controller;


import com.xja.model.entity.Question;
import com.xja.model.vo.resp.Result;
import com.xja.service.IQuestionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 问题表--用于体质评估 前端控制器
 * </p>
 *
 * @author caijg
 * @since 2025-06-08
 */
@RestController
@RequestMapping("/user/questions")
@RequiredArgsConstructor
@Slf4j
@Tag(name = "问卷问题模块")
public class QuestionController {

    private final IQuestionService questionService;

    @Operation(summary = "获取问题列表")
    @GetMapping
    public Result<List<Question>> getQuestions() {
        log.info("用户请求获取问题列表");
        List<Question> questionList = questionService.list();
        return Result.success(questionList);
    }
}